<template>
  <div class="recommend">
    <div class="title">猜你喜欢</div>
    <ul>
      <router-link tag="li" :to="'/detail/' + item.id" v-for="item of list" :key="item.id" class="item border-bottom">
        <div class="item-img">
          <img :src="item.imgUrl" alt="">
          <div class="item-img-tag">随买随用</div>
        </div>
        <div class="item-intro">
          <div class="item-intro-title">{{item.title}}</div>
          <div class="item-intro-stars">
            <div></div>
            <span>{{item.desc}}</span>
          </div>
          <div class="item-intro-prices">
            <span>&yen;50</span>起
            <div class="address">修武县</div>
          </div>
        </div>
      </router-link>
    </ul>
  </div>
</template>
<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  }
}
</script>
<style lang="stylus" scoped>
@import '~css/variable.styl'
@import '~css/mixin.styl'
  .recommend
    padding 0 .2rem
    .title
      height 0.8rem
      line-height .8rem
      font-size .4rem
    .item
      display flex
      padding .2rem 0
      &-img
        position relative
        flex 0 0 2rem
        overflow hidden
        img
          display block
          width 100%
          object-fit cover
        &-tag
          position absolute
          top 0
          left 0
          width 1.03rem
          height .4rem
          line-height .4rem
          background url(https://img1.qunarzz.com/piao/fusion/1802/52/b9080e45b69b4f02.png) no-repeat center / 1.03rem auto
          text-indent .15rem
          color #fff
      &-intro
        flex 1
        margin-left .2rem
        overflow hidden
        &-title
          font-size .4rem
          height .7rem
          line-height .7rem
        &-stars
          font-size .3rem
          height .8rem
          line-height .8rem
          color $secondColor
          ellipsis()
        &-prices
          position relative
          font-size .25rem
          span
            font-size .4rem
            color #ff8300
          .address
            position absolute
            right .1rem
            top .1rem
            font-size .25rem
            color $secondColor
</style>
